<?php
/**
 * @copyright meila.com
 * @author shaopu@
 * @name 
 * @param 
 *         $xxx = 作用
 * @static 
 *         XXX = 作用
 * 
 * 
 */
$dir = dirname(dirname(__FILE__));
include($dir.'/__queue_global.php');

class ml_mq_add_sys_notice extends MqClass{
    const QUEUE_NAME = ML_QUEUENAME_ADD_SYS_NOTICE;

    /**
     * 注释
     *
     * @param array $message_data
     * array(
     *                        所接收的参数说明
     *        )
     * )
     */
    public function run_job(){
        $arr = $this->src_data;
        $aUids = $arr['uids'];
        $content = $arr['content'];
        
        $oSysNtcC = new ml_model_dbSysNoticeContent();
        $oSysNtcRel = new ml_model_dbSysNoticeRel();
        $oRdsNtc = new ml_model_rdsNotice();
        
        $oSysNtcC->addNotice($content);
        $content_id = $oSysNtcC->insert_id();
        foreach ($aUids as $uid)
        {
            /**
             * @todo 
             */
            $oSysNtcRel->addNotice($uid , $content_id);
            $oRdsNtc->add_notice($uid , ml_model_rdsNotice::NTCTYPE_ADDSYSNOTICE );
        }
        
        return true;
    }
}

ml_run_queue_check(ml_mq_add_sys_notice::QUEUE_NAME);
$xblog_obj = new ml_mq_add_sys_notice(new RsQueue(ml_mq_add_sys_notice::QUEUE_NAME));
$argv[1]   = __FILE__;
$xblog_obj->setArgv($argv[1]);
$xblog_obj->execute();
?>